import { QXEvent } from 'qx-util';
import { IControllerParams, ILoadingHelper } from '../../modules';
import { IViewAbility } from '../ability';
import { IViewEvent, ViewActionType } from '../event/i-view-event';

/**
 * 视图控制器输入参数接口
 *
 * @export
 * @interface IViewControllerParams
 * @extends {IControllerParams}
 * @template T 视图行为类型接口
 * @template A 视图能力接口
 */
export interface IViewControllerParams<T, A extends IViewAbility = IViewAbility>
	extends IControllerParams {
	/**
	 * 视图事件
	 *
	 * @type {QXEvent<IViewEvent>}
	 * @memberof IViewControllerParams
	 */
	evt: QXEvent<IViewEvent<T | ViewActionType, A>>;

	/**
	 * 视图打开方式
	 *
	 * @type {('ROUTE' | 'EMBED' | 'MODAL')}
	 * @memberof IViewControllerParams
	 */
	openType: 'ROUTE' | 'EMBED' | 'MODAL';

	/**
	 * 父级加载助手
	 *
	 * @type {ILoadingHelper}
	 * @memberof IViewControllerParams
	 */
	pLoadingHelper: ILoadingHelper | undefined;

	/**
	 * 是否默认加载
	 *
	 * @type {boolean}
	 * @memberof IViewControllerParams
	 */
	isLoadDefault: boolean;
}
